<?php

namespace App\Http\Controllers;

use App\Models\CouponUser;
use Illuminate\Http\Request;

class CouponUserController extends Controller
{
    public function index(Request $request)
    {
        $data = CouponUser::with(['coupon'])->where('user_id', $request->user()->id)->orderBy('status', 'asc')->orderBy('end_time', 'asc')->paginate();
        return $this->response($data);
    }
}
